Skip to content

feat(web): a chat opens where you left it - #987

Merged
badcuban merged 3 commits into
mainfrom
feat/thread-scroll-memory
Nov 18, 2026
Merged

badcuban merged 3 commits into
mainfrom
feat/thread-scroll-memory

Conversation

@badcuban

Copy link
Copy Markdown
Collaborator

Leaving a chat scrolled up and coming back used to open it at the end, so you lost your place every time you switched threads.

Each chat now remembers the row at the top of the view and how far into that row you were, in memory for the window (a reload opens every chat at the end). Coming back opens the list right there on its first drawn frame, with no flash of the end.

It opens at the end, as before, when:

  • the chat was left at its end (it keeps following new output);
  • something new happened since you last saw it: an unseen answer or failure, or an approval or question waiting on you;
  • you opened it at a find result (the result wins);
  • the remembered row is gone (a revert or rewrite).

Archiving or deleting a thread forgets its place, including when the thread list is rebuilt after a reconnect. At most 300 threads are remembered; the one left longest ago goes first. Only the main chat is covered, not the side panel.

Nothing runs while scrolling: the place is read once when a chat is left, and once when it opens.

Tests: pure tests for the memory rules, a news-rule test, and browser tests that the same row lands within 2px on every frame from the first, that a chat left at the end or with news opens at the end, and that a find result wins.

Each thread remembers the row at the top of the view and how far into it
the view was, in memory, when its chat is left above the end. Coming back
opens the list there on its first frame. A chat left at the end, one with
news since (an unseen completion or failure, or a status that needs you),
one opened at a find target, and one whose row is gone open at the end as
before. Archive and delete forget the entry.
- Read the list when the chat is left, not when the save was armed: a
  pinned list rebuilt after a turn settles left a dead handle that threw.
- A restored chat starts as at the end for the scroll-to-bottom button,
  so the list's first report above the end shows it.
- A failure already seen is not news; only unseen failures, approvals and
  questions open the chat at the end.
- A full thread list after a reconnect forgets archived and deleted
  threads, as terminal state does.
- The browser test harness clears scroll memory per mount.
@vercel

vercel Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
threadlines Skipped Skipped Nov 18, 2026 3:29am UTC

Request Review

…mory

# Conflicts:
#	apps/web/src/components/ChatView.sidebar.browser.tsx
@badcuban
badcuban added this pull request to the merge queue Nov 18, 2026
Merged via the queue into main with commit 4d8f45f Nov 18, 2026
24 checks passed
@badcuban
badcuban deleted the feat/thread-scroll-memory branch November 18, 2026 03:44

This branch was previously deployed

1 inactive deployment
Preview — f9e28430 Deployed Nov 18, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant